package com.test.jbpm.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.test.jbpm.Pager;
import com.test.jbpm.dao.UserDao;
import com.test.jbpm.domain.User;
import com.test.jbpm.service.UserService;


@Service
public class UserServiceImpl implements UserService {

	private UserDao userDao;
	
	@Autowired
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public void addOrUpdate(User user) {
			userDao.addOrUpdate(user);
	}

	public void del(Integer userId) {
		userDao.del(userId);
	}

	public User findUserById(Integer userId) {
		return userDao.findUserById(userId);
	}

	public Pager<User> findUserList() {
		return userDao.findUserList();
	}

	public void del(Integer[] userIds) {
		for (Integer userId : userIds) {
			userDao.del(userId);
		}
	}

	public User login(String userCode, String password) {
		return userDao.login(userCode, password);
	}

}
